package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;
import com.link2room.rodimus.constant.MallOrderConstant;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by LN on 2018/1/24
 */
@Entity
@Table(name = "mall_order_opt_sta")
public class MallOrderOptStaEntity extends BaseEntity{
    public MallOrderOptStaEntity() {
    }

    public MallOrderOptStaEntity(String lholetGroupCode , String mallOrderNo, String item, String operSta, String operType) {
        setLhotelGroupCode(lholetGroupCode);
        this.mallOrderNo = mallOrderNo;
        this.item = item;
        this.operSta = operSta;
        this.operType = operType;
    }

    public static MallOrderOptStaEntity createSoundwaveBusssStaEntity(String lhotelGroupCode, String orderNo){
        return new MallOrderOptStaEntity(lhotelGroupCode,orderNo, MallOrderConstant.ORDER_OPT.ITEM.SOUNDWAVE_BUSSS,MallOrderConstant.ORDER_OPT.STA.T,MallOrderConstant.ORDER_OPT.TYPE.CREATE);
    }
    public static MallOrderOptStaEntity createSoundwavePayStaEntity(String lhotelGroupCode, String orderNo){
        return new MallOrderOptStaEntity(lhotelGroupCode,orderNo, MallOrderConstant.ORDER_OPT.ITEM.SOUNDWAVE_POINT_PAY,MallOrderConstant.ORDER_OPT.STA.T,MallOrderConstant.ORDER_OPT.TYPE.CREATE);
    }
    public static MallOrderOptStaEntity fallbackTrailbreakerStaEntity(String lhotelGroupCode,String orderNo){
        return new MallOrderOptStaEntity(lhotelGroupCode,orderNo, MallOrderConstant.ORDER_OPT.ITEM.TRAILBREAKER,MallOrderConstant.ORDER_OPT.STA.T,MallOrderConstant.ORDER_OPT.TYPE.FALLBACK);
    }
    private String mallOrderNo;
    private String item;
    private String operSta;
    private String operType;

    @Basic
    @Column(name = "mall_order_no")
    public String getMallOrderNo() {
        return mallOrderNo;
    }

    public void setMallOrderNo(String mallOrderNo) {
        this.mallOrderNo = mallOrderNo;
    }

    @Basic
    @Column(name = "item")
    public String getItem() {
        return item;
    }

    public void setItem(String item) {
        this.item = item;
    }

    @Basic
    @Column(name = "oper_sta")
    public String getOperSta() {
        return operSta;
    }

    public void setOperSta(String operSta) {
        this.operSta = operSta;
    }

    @Basic
    @Column(name = "oper_type")
    public String getOperType() {
        return operType;
    }

    public void setOperType(String operType) {
        this.operType = operType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MallOrderOptStaEntity that = (MallOrderOptStaEntity) o;

        if (mallOrderNo != null ? !mallOrderNo.equals(that.mallOrderNo) : that.mallOrderNo != null) return false;
        if (item != null ? !item.equals(that.item) : that.item != null) return false;
        if (operSta != null ? !operSta.equals(that.operSta) : that.operSta != null) return false;
        if (operType != null ? !operType.equals(that.operType) : that.operType != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = mallOrderNo != null ? mallOrderNo.hashCode() : 0;
        result = 31 * result + (item != null ? item.hashCode() : 0);
        result = 31 * result + (operSta != null ? operSta.hashCode() : 0);
        result = 31 * result + (operType != null ? operType.hashCode() : 0);
        return result;
    }
}
